package copyengine.ui.dragdrop.impl.source
{
	import copyengine.ui.dragdrop.IDragDropTarget;
	import copyengine.ui.dragdrop.impl.logic.ICEDragDropLogicMove;
	import copyengine.ui.dragdrop.impl.target.CEDragDropTargetPro;

	public class CEDragDropSourcePro extends CEDragDropSourceCore
	{
		protected var moveLogic:ICEDragDropLogicMove;

		public function CEDragDropSourcePro()
		{
			super();
		}

		override public function onDragDropBegin(_target:IDragDropTarget, _x:Number, _y:Number):void
		{
			moveLogic.moveTo(_target, _x, _y);
		}

		public final function setLogic(_moveLogic:ICEDragDropLogicMove):void
		{
			moveLogic = _moveLogic;
		}

		override public function onMove(_target:IDragDropTarget, _x:Number, _y:Number):void
		{
			moveLogic.moveTo(_target, _x, _y);
		}

		override protected function doOnDragDropEnd():void
		{
			moveLogic.dispose();
			moveLogic = null;
		}

		override protected function initializeDragDropIcon():void
		{
			dragDropIconContainer.addChild(moveLogic.getDragDropLayerIcon());
		}

	}
}